<!doctype html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery HTML表格生成Excel文件插件 - 站长素材</title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/htmleaf-demo.css">
</head>
<body>
<section class="zzsc">
	<div class="container" style="padding:30px 0">
		<div class="row">
			<div class="md-col-8">
				<div class="table-responsive table2excel" data-tableName="Test Table 1">
				  <table class="table table-striped table-bordered table-hover">
					<thead>
					  <tr class="noExl">
						<td class="danger">带<code>noExl</code>class的行不会被输出到excel中</td>
						<td class="danger">带<code>noExl</code>class的行不会被输出到excel中</td>
					  </tr>
					  <tr>
						<td class="success">这一行会被导出到excel中</td>
						<td class="success">这一行会被导出到excel中</td>
						</tr>
						<tr>
							<td class="success">这一行会被导出到excel中</td>
							<td class="success">这一行会被导出到excel中</td>
							</tr>
							<tr>
								<td class="success">这一行会被导出到excel中</td>
								<td class="success">这一行会被导出到excel中</td>
								</tr>
								<tr>
									<td class="success">这一行会被导出到excel中</td>
									<td class="success">这一行会被导出到excel中</td>
									</tr>
					</thead>
					<tbody>
					  <tr>
						<td>单元格1-1</td>
						<td>单元格1-2</td>
					  </tr>
					  <tr>
						<td>单元格2-1</td>
						<td>单元格2-2</td>
					  </tr>
					  <tr>
						<td>单元格3-1</td>
						<td>单元格3-2</td>
					  </tr>
					</tbody>
					<tfoot>
						<tr>
						<td colspan="2" class="warning">合并2个单元格</td>
						</tr>
					</tfoot>
				  </table>
				</div>
			</div>
		</div>
		<button id="btn" class="btn btn-primary">点击这里将表格内容导出到excel中</button>
	</div>
</section>

<script src="js/jquery-1.11.0.min.js" type="text/javascript"></script>
<script src="dist/jquery.table2excel.js"></script>
<script>
	$(function() {
		$("#btn").click(function(){
			$(".table2excel").table2excel({
				exclude: ".noExl",
				name: "Excel Document Name",
				filename: "myFileName",
				exclude_img: true,
				exclude_links: true,
				exclude_inputs: true
			});
		});
		
	});
</script>

<div style="text-align:center;margin:50px 0; font:normal 14px/24px 'MicroSoft YaHei';">
<p>适用浏览器：360、FireFox、Chrome、Safari、Opera、傲游、搜狗、世界之窗. 不支持IE8及以下浏览器。</p>
<p>来源：<a href="http://sc.chinaz.com/" target="_blank">站长素材</a></p>
</div>
</body>
</html>